package com.eleventwelve.iris.web.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.eleventwelve.iris.entity.IrisUser;
import com.eleventwelve.iris.service.IrisUserService;

/**
 * 
 * @author Ashley
 *
 */
public class DashboardController extends AbstractController{

	private String viewName;
	private IrisUserService irisUserService;
	
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		Map<String, Object> map = new HashMap<String, Object>();
		
		IrisUser user = irisUserService.getCurrentUser();
		
		map.put("user", user);
		
		return new ModelAndView(viewName, map);
	}

	public String getViewName() {
		return viewName;
	}

	public void setViewName(String viewName) {
		this.viewName = viewName;
	}

	public IrisUserService getIrisUserService() {
		return irisUserService;
	}

	public void setIrisUserService(IrisUserService irisUserService) {
		this.irisUserService = irisUserService;
	}


}
